const state = {
  typePage: {},
  typeList: []
}

const actions = {
  saveTypes: ({ commit }, payload) => {
    commit('SAVETYPES', payload)
  }
}

const mutations = {
  SAVETYPES: (state, payload) => {
    state.typeList = payload.result,
    state.typePage = {
      size: 10,
      number: payload.number || 1,
      total: payload.resultNum
    }
  }
}

export default {
  state,
  actions,
  mutations
}